package com.kaifamiao.exercises.array;

public class SixtyYears {
    public static void main(String[] args) {
        // 天干
        char[] heavenlyStems = { '甲', '乙', '丙', '丁', '戊', '己', '庚', '辛', '壬', '癸' };
        // 地支
        char[] earthlyBranches = { '子', '丑', '寅', '卯', '辰', '巳', '午', '未', '申', '酉', '戌', '亥' };

        // 输出六十甲子名称 ( 要求每行输出12个，总共输出 5 行 )
        for( int i = 0 ; i < 60; i++ ){
            int hs = i % heavenlyStems.length;
            int eb = i % earthlyBranches.length;
            String yearName = heavenlyStems[hs] + "" + earthlyBranches[eb];
            System.out.print( yearName + ( (i + 1) % 12 == 0 ? "\n" : "\t") );
        }
    }
}
